package com.huiguo.methodargument.dto.command;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class UserCommand {
    @NotBlank(message = "名称不能为空")
    private String name;

    private Integer sex;

    /**
     * @Valid这个注解指定UserDetailCommand中的属性也需要校验
     */
    @Valid
    private UserDetailCommand userDetailCommand;
}
